import Layout from "@/layout";

//静态路由
export const constantRoutes = [

  {
    path: '/login',
    component: () => import('@/views/login/index'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/Home',
    children: [
      {
      path: 'home',
      name: 'Home',
      component: () => import('@/views/home/index'),
      meta: { title: '首页', icon: 'el-icon-house' }
    }
    ]
  },
  ]

//权限路由
export const allAsyncRoute = [


  {
    path: '/Acl',
    component: Layout,
    redirect: '/acl',
    name: 'Acl',
    meta: { title: '权限管理', icon: 'el-icon-setting' },
    children: [
      {
        path: 'user',
        name: 'User',
        component: () => import('@/views/acl/user'),
        meta: { title: '用户管理'}
      },
      {
        path: 'role',
        name: 'Role',
        component: () => import('@/views/acl/role'),
        meta: { title: '角色管理' }
      },
      {
        path: 'permission',
        name: 'Permission',
        component: () => import('@/views/acl/permission'),
        meta: { title: '菜单管理' }
      }
    ]
  },


  {
    path: '/product',
    component: Layout,
    // redirect: '/goods/trademark',
    name: 'Product',
    meta: {
      title: '商品管理',
      icon: 'el-icon-receiving'
    },
    children: [
      {
        path: 'trademark',
        component: () => import('@/views/goods/trademark/index'), // Parent router-view
        name: 'Trademark',
        meta: { title: '品牌管理' },
      },
      {
        path: 'attr',
        component: () => import('@/views/goods/attr/index'),
        name: 'Attr',
        meta: { title: '平台属性管理' }
      },
      {
        path: 'sku',
        component: () => import('@/views/goods/sku/index'),
        name: 'Sku',
        meta: { title: 'Sku管理' }
      },
      {
        path: 'spu',
        component: () => import('@/views/goods/spu/index'),
        name: 'Spu',
        meta: { title: 'Spu管理' }
      },
    ]
  },
]


//通配路由
export const anyRoute =
  // 404 page must be placed at the end !!!
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }

